package ch.nostromo.tiffanys.tests.problems;

import ch.nostromo.tiffanys.game.GameController;
import ch.nostromo.tiffanys.game.GameControllerException;
import ch.nostromo.tiffanys.game.player.PlayerEngine;
import ch.nostromo.tiffanys.tests.TestBase;

public class TestPromotion extends TestBase {

  public void testDisable() throws ClassNotFoundException, GameControllerException {
    PlayerEngine white = this.getEngineWithFixedDepth(6);
    PlayerEngine black = this.getEngineWithFixedDepth(6);
   
    String fenInput = "k7/r7/r7/8/P7/K7/3p4/3N4 w KQkq - 0 3";
      
    GameController gc = new GameController(white, black, fenInput);
    
    assertTrue(gc.computeNextMoveNow(false).getSelectedMove().getSanDescription().equals("Kb4"));
  }

  public void testEnable() throws ClassNotFoundException, GameControllerException {
    PlayerEngine white = this.getEngineWithFixedDepth(2);
    PlayerEngine black = this.getEngineWithFixedDepth(2);
   
    String fenInput = "k7/8/8/8/P7/K7/3p4/8 b KQkq - 0 3";
      
    GameController gc = new GameController(white, black, fenInput);
    
    assertTrue(gc.computeNextMoveNow(false).getSelectedMove().getSanDescription().equals("d1=Q"));
  }
  
}
